The agentic loop & hub-and-spoke orchestration.
One model call rarely finishes the job. Agents run a loop — call, act, observe, repeat — and the most reliable multi-agent systems wire those loops into a hub-and-spoke shape. Here's how the loop terminates, why a coordinator beats a free-for-all, and the rules that keep it from melting down.
The hub-and-spoke / orchestrator-worker pattern is documented in Anthropic's “How we built our multi-agent research system” (2025) and “Building effective agents.” Diagrams below are original visualizations built for this lesson.
1 · The agentic loop
An agent isn't a single completion — it's a loop. You call the model, and if it wants to use a tool, you run that tool, feed the result back, and call again. The loop continues until the model signals it's finished. The one thing that controls termination is stop_reason: end_turn means the model is done; tool_use means it's asking you to run a tool.
stop_reason. Distractors: parsing the text content, setting an iteration limit, or watching token counts.2 · From one agent to many: hub-and-spoke
When a task is too broad for one context window, you don't make the agent bigger — you split it. In the orchestrator-worker (a.k.a. hub-and-spoke) pattern, a central lead agent plans the work and delegates pieces to specialized subagents, each running its own loop in its own isolated context. Anthropic's multi-agent research system is the canonical example: a lead agent spawns 3–5 subagents that search in parallel, then a separate citation pass attributes the sources.
3 · Why the hub wins
The alternative — a flat “swarm” where agents talk to each other and share state — is flexible but nearly impossible to debug. Constraining the topology so workers only talk to the hub buys four concrete advantages:
4 · Spawning workers: the Task tool
Subagents are spawned with a dedicated tool. Three configuration rules matter for the exam and in practice:
- The coordinator's
allowedToolsmust include "Task" to enable subagent spawning. - Each
Taskcall specifies that subagent's prompt, tools, and context. Multiple Task calls in one response run in parallel. fork_sessionbranches a session for parallel exploration without polluting the parent's context.
“Workers never talk to each other. Every decision about what comes next lives in the orchestrator.”
— the core discipline of hub-and-spoke
When NOT to reach for it
Hub-and-spoke shines on breadth-first work that splits into independent strands. It's a poor fit for tightly interdependent tasks like most coding, where one decision constrains the next — and it costs ~15× the tokens, so reserve it for problems where the answer's value clearly outweighs the spend.
References & sources
- Anthropic (2025). How we built our multi-agent research system. anthropic.com/engineering/multi-agent-research-system
- Anthropic (2024). Building effective agents. anthropic.com/engineering/building-effective-agents
- Anthropic. Tool use with Claude (the agentic loop & stop_reason). docs.anthropic.com — tool use